#include "stdafx.h"
#include "SimpleRefection.h"
#include "Localization.h"


const   std::string& CMember::GetLocalizedName() const
{
	if(!m_bLocalized)
	{
		std::string& s =const_cast<std::string&>(m_sLocalizedName);
		s=Locatization::Instance().Localize(GetLocalizeTag());

	}const_cast<bool&>(m_bLocalized)=true;
	return m_sLocalizedName;
}

void CMember::SetOwner( CClass * pOwner )
{
	m_pOwner=pOwner;
	if(m_pOwner)
	{
		//std::stringstream ss;
		//ss<<GetOwner()->GetName()<<"."<<GetName();
		std::string strNameTmp = GetOwner()->GetName();
		strNameTmp += ".";
		strNameTmp += GetName();
		m_sLocalizeTag=strNameTmp;
	}
}

const std::string& CClass::GetLocalizedName() const
{
	if(!m_bLocalized)
	{
		std::string& s =const_cast<std::string&>(m_sLocalizedName);
		s=Locatization::Instance().Localize(GetName());

	}const_cast<bool&>(m_bLocalized)=true;
	return m_sLocalizedName;
}